Veery testing code=yes Read a Single Post ================== Grab my profile page. Currently, the default is to return HTML only. curl http://veeryapiperl.soupmode.com/api/posts/profile This produces the same thing. curl http://veeryapiperl.soupmode.com/api/posts/profile/?text=html { "status":200, "description":"OK", "post": { "author":"JohnR", "reading_time":0, "created_at":"2015/02/11 14:54:49", "updated_at":"2015/04/21 15:56:10", "slug":"profile", "post_type":"article", "title":"Profile", "word_count":16, "html":"\n
my profile page that contains nothing because i want to blend into the background.
\n\n\n" } } Get the markup. The _rev is returned for updating. Should this be returned, however, only if the client calling app is logged in? curl http://veeryapiperl.soupmode.com/api/posts/profile/?text=markup { "status":200, "description":"OK", "post": { "_rev":"3-97b3bc9434ea346a49b7709c6dd1e9fd", "title":"Profile", "slug":"profile", "post_type":"article", "markup":"# Profile\r\n\r\nmy profile page that contains nothing because i want to blend into the background.\r\n\r\n![](http://farm4.static.flickr.com/3156/2614312687_3fe4cae2a9_o.jpg)" } } Get the markup and the HTML. curl http://veeryapiperl.soupmode.com/api/posts/profile/?text=full { "status":200, "description":"OK", "post": { "author":"JohnR", "title":"Profile", "slug":"profile", "post_type":"article", "word_count":16, "reading_time":0, "created_at":"2015/02/11 14:54:49", "updated_at":"2015/04/21 15:56:10", "markup":"# Profile\r\n\r\nmy profile page that contains nothing because i want to blend into the background.\r\n\r\n![](http://farm4.static.flickr.com/3156/2614312687_3fe4cae2a9_o.jpg)", "html":"\nmy profile page that contains nothing because i want to blend into the background.
\n\n\n" } } Get the Homepage Stream of Posts ================================ curl http://veeryapiperl.soupmode.com/api/posts Page 3 of the stream of posts curl http://veeryapiperl.soupmode.com/api/posts/?page=3 { "status":200, "description":"OK", "posts": [ { "author":"JohnR", "reading_time":0, "more_text_exists":1, "tags":[], "text_intro":" test multimarkdown - Here is as example of [table][simple_table] followed by a more complex example from the documentation simple_table \tFirst Header \tSecond Header \tThird Header \t \tFirst row \tData \tVery long data entry \t \tSecond row \tCell \tCell \t Prototype table ...", "updated_at":"2015/04/30 01:57:55", "formatted_updated_at":"Apr 30, 2015 01:57:55 Z", "slug":"test-multimarkdown", "post_type":"article" }, { "author":"JohnR", "reading_time":0, "more_text_exists":0, "tags":["scaup","blogging"], "text_intro":"Info - Minimal web publishing tool. Formatting can be created by using markup syntax from Markdown, MultiMarkdown, Textile, and HTML. Tech used: Ubuntu Nginx FastCGI Perl HTML::Template CouchDB Memcached Elasticsearch #scaup #blogging", "updated_at":"2015/04/29 21:56:57", "formatted_updated_at":"Apr 29, 2015 21:56:57 Z", "slug":"info", "post_type":"article" } ] } Stream of posts from a search request ===================================== ** Currently, searches are done with GET requests. Should add or change this to POST requests? Search on "beer" curl http://veeryapiperl.soupmode.com/api/searches/string/beer Search on "craft beer" curl http://veeryapiperl.soupmode.com/api/searches/string/craft%20beer ** Elasticsearch notes: it seems that when entering a text string surrounded by double quotes, then an exact string match is conducted by Elasticsearch. When a plus sign separates words, then it seems than an OR Boolean search is conducted. ** will eventually support tag search curl http://veeryapiperl.soupmode.com/api/searches/tag/beer OR curl http://veeryapiperl.soupmode.com/api/tags/beer Returned JSON for search on "beer" : { "status":200, "description":"OK", "next_link_bool":0, "posts":[ { "author":"JohnR", "reading_time":1, "text_intro":" Black Cloister Feb 26 2015 notes - Feb 26, 2015 - Toledo Blade - Black Cloister Brewing Co. taps opening date The story is part of a new Blade column, called \"Raise a Glass.\" ", "slug":"black-cloister-feb-26-2015-notes", "formatted_updated_at":"Feb 26, 2015 16:14:32 Z", "post_type":"article", "more_text_exists":1, "tags":["toledo","beer","brewery"], "updated_at":"2015/02/26 16:14:32" }, { "author":"JohnR", "reading_time":1, "text_intro":"Jan 15, 2015 insights from Tom at Titgemeier's. - I visited Titgemeier's this morning to buy bird seed, honey, and a bottle capper. I broke our capper last night. I chatted with Tom for a while. We definitely missed a good Glass City Mashers meeting last Thursday. Chris spoke. He's the owne ...", "slug":"jan-15-2015-insights-from-tom-at-titgemeiers", "formatted_updated_at":"Feb 25, 2015 13:27:01 Z", "post_type":"article", "more_text_exists":1, "tags":["beer","business","toledo"], "updated_at":"2015/02/25 13:27:01" } ] } Login ===== curl -X POST -H "Content-Type: application/json" --data '{ "email" : "x@x.com"}' http://veeryapiperl.soupmode.com/api/users/login